package com.dubbo.study.echo.Impl;
import com.alibaba.dubbo.rpc.RpcContext;
import com.dubbo.study.echo.api.EchoService;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: dubbo-parent
 *
 * @description:
 *
 * @author: heqiang
 *
 * @create: 2019-10-18 10:36
 **/
public class EchoServiceImpl implements EchoService {


    @Override
    public String echo(String message) {
        String now = new SimpleDateFormat("HH:mm:ss").format(new Date());
        String a = "["+now+"] hello"+message+", request from consumer:"+ RpcContext.getContext().getRemoteAddress();
        return a;
    }
}
